# Maintainer: Andy Postnikov <apostnikov@gmail.com>
pkgname=php81-pecl-decimal
_extname=decimal
pkgver=1.4.0
pkgrel=1
pkgdesc="Correctly-rounded arbitrary precision decimal floating-point arithmetic in PHP 8.1 - PECL"
url="https://pecl.php.net/package/decimal"
arch="all"
license="MIT"
depends="php81-common"
makedepends="php81-dev mpdecimal-dev"
source="php-pecl-$_extname-$pkgver.tgz::https://pecl.php.net/get/$_extname-$pkgver.tgz
	fix-test.patch"
builddir="$srcdir/$_extname-$pkgver"

install_if="php-$_extname php$_phpv"

build() {
	phpize81
	./configure --prefix=/usr --with-php-config=php-config81
	make
}

check() {
	make NO_INTERACTION=1 REPORT_EXIT_STATUS=1 test TESTS=--show-diff
}

package() {
	make INSTALL_ROOT="$pkgdir" install
	local _confdir="$pkgdir"/etc/php81/conf.d
	install -d $_confdir
	echo "extension=$_extname" > $_confdir/$_extname.ini
}

sha512sums="
39c7044a6e2f31cd2ca006fb2fe27b547ea717312a7ad1aee7a656aa60d99cc1198e6e9dcf0b90157f3514e110645f6b0fd47ccae0411d6c837dea3b6de1c521  php-pecl-decimal-1.4.0.tgz
7dc3ba2b75238f14cabe0125a25903c0a48ca5aed823156fe15250a012bab7684174af8138b418431e8c818eb5de519db208c6a90e0238da12046cbf29296e2d  fix-test.patch
"
